#!/bin/bash
. /etc/rc.d/init.d/functions
. /etc/sysconfig/network
MIP="172.16.1.138"
USER="teleepoch"
PASSWD="1234"
MCMD="/usr/local/bin/mysql"
LIP=`ifconfig |grep "172.16"|awk '{print $2}'|cut -d ':'  -f 2`
QID=`$MCMD -u$USER -p$PASSWD -h$MIP -e "show processlist;"|grep activemq|grep $LIP|awk '{print $1}'`
if [ "$QID"!='' ] ; then
for i in $QID
do
$MCMD  -u$USER -p$PASSWD -h$MIP  -e "kill $i"
done
fi
exit 0
